<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<title><?php echo ($name); ?></title>
<script src="__APP__/statics/jquery-1.9.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>
<style>
 body{font-family:"微软雅黑";font-size:12px;color:#666666;background-color:#F9F9F6}
 *{margin: 0;} 
 a{text-decoration:none}
 img{border:0px}
.cat{background-color:#F9F9F6;margin-left:10px;z-index:0;}
.cat_list:hover{background-color:#fff;}
.title{background:url("__APP__/statics/tbg.gif");font-weight:bold}

#save{text-align:center;border:0;width:100%;height:40px;background-color:#fff;position:fixed;left:0px;bottom:0px;z-index:999;border:1px solid #DFDFDF;background-color:#DFDFDF;padding:5px;height:20px}
</style>

<?php if($place["type"] == 1): ?><script type="text/javascript" charset="utf-8">window.UEDITOR_HOME_URL= "__PUBLIC__/ueditor/";</script>
 <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/editor_config.js"></script>
 <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/editor_all.js"></script><?php endif; ?>
 <script type="text/javascript" src="__APP__/statics/time/lhgcalendar.min.js"></script>
<script type="text/javascript">
	$(function(){
		$('[name=end_time]').calendar();
	});
</script>
<style>
body{font-size:15px;}
</style>
<form method="POST" enctype="multipart/form-data" action="__URL__/insert">
<table border="1" width="100%" style="border-collapse: collapse" bordercolor="#CCCCCC">
	<tr height="30">
		<td align="right">广告位置：</td>
		<td><?php echo ($place["place_name"]); ?><input type="text" name="place_tag" value="<?php echo ($place["place_tag"]); ?>" style="display:none"></td>
	</tr>
	<tr height="30">
		<td align="right">广告类型：</td>
		<td>
<?php switch($place["type"]): case "1": ?>文字<?php break;?>
    <?php case "2": ?>图片<?php break;?>
	<?php case "3": ?>flash<?php break;?>
	<?php case "4": ?>代码<?php break; endswitch;?>
        <input type="text" name="type" value="<?php echo ($place["type"]); ?>" style="display:none">
        </td>
	</tr>
	<tr height="30">
		<td align="right">内容：</td>
		<td>
<?php switch($place["type"]): case "1": ?><textarea name="content" id='word'></textarea><?php break;?>
    <?php case "2": ?><input type="button" id="add_more" value="再加一个">
	     <div id="content">链接：<input type="text" name="url" size="30" value="http://">—<input type="file" name="pic[]" size="20"></div><br>
		 是否新窗口打开<input type="checkbox" name="new_win"><?php break;?>
	<?php case "3": ?><div id="content">链接：<input type="text" name="url" size="30" value="http://">—<input type="file" name="flash[]" size="20"></div><?php break;?>
	<?php case "4": ?><textarea name="content" cols="60" rows="10"></textarea><?php break; endswitch;?>
		</td>
	</tr>
	<tr height="30">
		<td align="right">宽x高：</td>
		<td><input type="text" name="chang" size="4">x<input type="text" name="kuan" size="4"></td>
	</tr>
	<tr height="30">
		<td align="right">显示截至时间：</td>
		<td><input type="text" name="end_time" size="20" value="0">为0则一直显示</td>
	</tr>
	<tr height="30">
		<td align="right">排序：</td>
		<td><input type="text" name="sort" size="9" value="0"></td>
	</tr>
	<tr height="30">
		<td align="right">是否显示：</td>
		<td>
		  <input type="radio" value="true" checked name="is_show">是
		  <input type="radio" value="false" name="is_show">否
		</td>
	</tr>
</table>
<br><br>
<div id="save"><input type="submit" style="padding:2px;" value="添加广告"></div>
</form>

<script>
$("#add_more").click(function(){
     $('<dt>链接：<input type="text" name="url" size="30" value="http://">—<input type="file" name="pic[]" size="20"><a href="javascript:;" name="del">移除</a></dt>').appendTo($("#content"));
	 remove();
})

function remove(){
      $("a[name=del]").unbind().click(function () {
          $(this).parent().remove();
	  })
}
</script>
<?php if($place["type"] == 1): ?><SCRIPT type="text/javascript">  
    var editor = new UE.ui.Editor({
    initialFrameHeight:180
	,initialFrameWidth:600
	,toolbars:[
            ['fullscreen', 'source', '|', 'undo', 'redo', '|',
                'bold', 'italic', 'underline','|', 'forecolor', 'backcolor',  '|',
                'fontfamily', 'fontsize', '|',
                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify','link', 'unlink']
        ]
}); 
    editor.render("word");  
</SCRIPT><?php endif; ?>